package com.kfm.jdbc.day0329;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Demo05 {


    public static void main(String[] args) {
        try(FileInputStream fileInputStream = new FileInputStream("d:\\io\\buffered-input.txt");
            BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);){

            int read = bufferedInputStream.read();

            bufferedInputStream.skip(2);

            bufferedInputStream.mark(0);

            bufferedInputStream.skip(5);

            bufferedInputStream.mark(0);

            bufferedInputStream.skip(5);

            bufferedInputStream.reset();

            int read1 = bufferedInputStream.read();
            System.out.println((char)read1);

        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
